{extend name="admin/public/base"/}
{block name="body"}
<div class="box box-primary">
	<div class="box-header with-border">
		<h3 class="box-title">{$meta_title}</h3>
	</div>
	<div class="box-body">
		<form method="post" class="form form-horizontal" role="form">
			<div class="nav-tabs-custom">
				<ul class="nav nav-tabs">
					<li class="active">
						<a href="#tab-base" data-toggle="tab">基 础</a>
					</li>
					<li><a href="#tab-better" data-toggle="tab">高 级</a></li>
				</ul>
				<div class="tab-content">
					<div class="tab-pane fade in active" id="tab-base">
						<div class="form-group" style="display: none;">
							<label class="col-sm-2 control-label">上级分类</label>
							<div class="col-sm-8">
								<select class="form-control selectpicker" style="width: auto; min-width: 200px;" name="pid">
									<option value="">请选择</option>
									{volist name="category" id="item"}
									<option value="{$item['id']}" {if isset($info['pid']) && $item['id'] == $info['pid']}selected{/if}>{$item['title_show']|raw}</option>
									{/volist}
								</select>
								<span class="help-block"></span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">分类名称</label>
							<div class="col-sm-8">
								<input type="text" name="title" class="form-control" value="{$info.title|default=''}" data-rule="required">
								<span class="help-block">（名称不能为空）</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">分类标识</label>
							<div class="col-sm-8">
								<input type="text" name="name" class="form-control" value="{$info.name|default=''}">
								<span class="help-block">（英文字母）</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">分组定义</label>
							<div class="col-sm-8">
								<textarea name="groups" class="form-control">{$info.groups|default=''}</textarea>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">绑定模型</label>
							<div class="col-sm-8">
								<select name="model_id" class="form-control selectpicker" style="width: auto; min-width: 200px;" data-rule="required">
									<option value="">--请选择--</option>
									{volist name="model_list" id="item"}
									<option value="{$item['id']}" {if isset($info['model_id']) && $info['model_id'] == $item['id']}selected{/if}>{$item['title']}</option>
									{/volist}
								</select>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">发布内容</label>
							<div class="col-sm-8">
								<label class="am-radio-inline"><input type="radio" name="allow_publish" value="0">不允许</label>
								<label class="am-radio-inline"><input type="radio" name="allow_publish" value="1" checked>仅允许后台</label>
								<label class="am-radio-inline"><input type="radio" name="allow_publish" value="2" >允许前后台</label>
								<span class="help-block">（是否允许发布内容）</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">
								是否审核
							</label>
							<div class="col-sm-8">
								<label class="am-radio-inline"><input type="radio" name="check" value="0" checked>不需要</label>
								<label class="am-radio-inline"><input type="radio" name="check" value="1">需要</label>
								<span class="help-block">（在该分类下发布的内容是否需要审核）</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">分类图标</label>
							<div class="col-sm-8">
								{:form(['name'=>'icon','type'=>'image'],$info)}
							</div>
						</div>
						
					</div>
					<div class="tab-pane fade" id="tab-better">

						<div class="form-group">
							<label class="col-sm-2 control-label">可见性</label>
							<div class="col-sm-10">
								<select name="display" class="form-control selectpicker" style="width: auto; min-width: 200px;">
									<option value="1">所有人可见</option>
									<option value="0">不可见</option>
									<option value="2">管理员可见</option>
								</select>
								<span class="help-block">（是否对用户可见，针对前台）</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">排序</label>
							<div class="col-sm-2">
								<input type="text" name="sort" class="form-control" value="{$info.sort|default=0}">
								<span class="help-block">（仅对当前层级分类有效）</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">列表行数</label>
							<div class="col-sm-5">
								<input type="text" name="list_row" class="form-control" value="{$info.list_row|default=10}">
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label">网页标题</label>
							<div class="col-sm-8">
								<input type="text" name="meta_title" class="form-control" value="{$info.meta_title|default=''}">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">关键字</label>
							<div class="col-sm-8">
								<textarea class="form-control" name="keywords">{$info.keywords|default=''}</textarea>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">描述</label>
							<div class="col-sm-8">
								<textarea class="form-control" name="description">{$info.description|default=''}</textarea>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">列表模板</label>
							<div class="col-sm-8">
								<input type="text" name="template_lists" class="form-control" value="{$info.template_lists|default=''}">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">编辑模板</label>
							<div class="col-sm-8">
								<input type="text" name="template_edit" class="form-control" value="{$info.template_edit|default=''}">
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<input type="hidden" name="id" value="{$info['id']|default=''}">
					<button type="submit" class="btn btn-success submit-btn">确认提交</button>
					<button class="btn btn-danger btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
				</div>
			</div>
		</form>
	</div>
</div>
{/block}

{block name="script"}
<link rel="stylesheet" type="text/css" href="__static__/plugins/webuploader/webuploader.css">
<script type="text/javascript" src="__static__/plugins/webuploader/webuploader.min.js"></script>
<script type="text/javascript" src="__static__/plugins/webuploader/webuploader.custom.js"></script>
<script type="text/javascript">
	$(function(){
		$("input[name=reply]").change(function(){
			var $reply = $(".form-group.reply");
			parseInt(this.value) ? $reply.show() : $reply.hide();
		}).filter(":checked").change();
	});
</script>
{/block}